



import { requestClient } from '#/api/request';


// 用户账号列表
export async function $gethabitlist(data: any) {
  return requestClient.get<any>('app/user', { params: data });
}

// 获取详情
export async function $getdesc(id: any, data: any) {
  return requestClient.get<any>(`app/user/${id}`, { params: data });
}


// 添加用户
export async function $createaccount(data: any) {
  return requestClient.post<any>('app/user', data);
}

// 编辑用户
export async function $updateaccount(id: any, data: any) {
  return requestClient.put<any>(`app/user/${id}`, data);
}

// 删除用户
export async function $deleteaccount(data: any) {
  return requestClient.delete<any>(`app/user/${data.id}`, { params: data });
}

// 批量删除
export async function $deleteaccounts(data: any) {
  return requestClient.delete<any>(`app/user/many`, data);
}


// 更改账号状态
export async function $updateuserstatus(data: any) {
  return requestClient.put<any>(`app/user/use-status`, data);
}

// 获取当前账号信息
export async function $desc(data: any) {
  return requestClient.get<any>(`app/user/current`, { params: data });
}


// 修改密码
export async function $changepassword(data: any) {
  return requestClient.post<any>('app/user/current/change-password', data);
}



// 修改当前账号信息
export async function $changeinfo(data: any) {
  return requestClient.get<any>(`app/user/current`, { params: data });
}

// 更改账号状态
export async function $updateinfo(data: any) {
  return requestClient.put<any>(`app/user/current`, data);
}




